#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>
#include "mydatabase.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    QTcpServer *server;
public slots:
    void on_newClient_connect();
    void on_readRead_handler();
    void mdisconnected();
    void mComboBox_refresh();
private slots:
    void on_btnlisten_clicked();

    void on_btnsend_clicked();

    void on_comboBoxChildren_activated(int index);

    void on_btnstoplisten_clicked();

    void on_btnlineout_clicked();

private:
    Ui::Widget *ui;
    int childIndex;
    //MyDatabase *database;
    QTcpSocket *patientsocket=nullptr;
    QTcpSocket *doctorsocket=nullptr;
};
#endif // WIDGET_H
